<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<base href="<%=basePath%>">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
<%@include file="/esayuiStyle.jsp" %>
<script type="text/javascript">
$(function(){
	$("#drugPrescribeTable").datagrid({
		pagination:true,
		idField:"id"
	})
	$("#prescribeParent").datagrid({
		idField:"id"
	}) 
	
	$("#dictionaryParent").datagrid({
		onClickRow:function (){
			var id = $("#prescribeParent").datagrid('getSelected');
			var postData = {'parent.id':id.id};
			$("#drugPrescribeTable").datagrid("reload",postData);	
		}
		
	})
})
function prescribeFormatter(value,row,index){
			return row.patient.name;
}
</script>
</head>
<body>
<div>
	<div style="float: left;width:10%;">
		<table id="prescribeParent" title="基本类别" width="200" height="400"
			data-options="url:'prescribe/getListByConditionWeiNa',method:'post',fitColumns:true,singleSelect:true">
			<thead>
				<tr>
				    <th data-options="field:'sasda',width:200,formatter:prescribeFormatter" id="patient">value</th>
				</tr>
			</thead>
		</table>
	</div>
	<div style="float: left;width:90%;">
		<table id="drugPrescribeTable" title="物品" width="100%" height="400"
			data-options="url:'dictionary/list',method:'post',fitColumns:true,striped:true,rownumbers:true ">
			<thead>
				<tr name="as">
					<th data-options="field:'tyu',checkbox:true"></th>
				    <th data-options="field:'id',width:30,sortable:true">Id</th>
				    <th data-options="field:'key',width:100,sortable:true">key</th>
				    <th data-options="field:'value',width:100,sortable:true">value</th>
				    <th data-options="field:'state',width:200,sortable:true">State</th>
				</tr>
			</thead>
		</table>
	</div>
</div>


</body>
</html>